<?=view("home.common.header")?>
<div class="container-fluid">
    <div class="row">
        <div class="col-xs-12 col-sm-12 bottom-line">
            <i class="glyphicon glyphicon-chevron-right jt"></i><span class="headfont">请选择宽带安装小区</span>
        </div>
    </div>
    <div class="row">
        <div class="col-xs-12 col-sm-12">
            <div class="kdsl mbottom0">搜索小区</div>
        </div>
        <div class="col-xs-12 col-md-12 area">
            <div class="input-group">
                <input type="text" name="plotname" class="form-control" placeholder="--请输入宽带安装小区名--">
                <span class="input-group-btn">
                    <button class="btn btn-orange mtop15 eveSearch" type="button">搜 索</button>
                </span>
            </div><!-- /input-group -->
        </div>
    </div>
    <div class="row">
        <div class="col-xs-12 col-sm-12" id="plotlist" style="display: none;">
            <div class="kdsl mbottom0">小区列表</div>
            <div class="plotlist">
                
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-xs-12 col-sm-12 padding0">
            <img class="bottom-img" src="<?=asset("images/djyh1.PNG")?>" />
        </div>
    </div>
</div>
<script>
    $('.eveSearch').click(function(){
        var plotname = $("input[name=plotname]").val();
        if (plotname == "") {
            layer.open({
                content: "请输入要安装宽带的小区名称",
                style: 'background-color:#09C1FF; color:#fff; border:none;',
                time: 2
            });
            $("input[name=plotname]").focus();
            return false;
        }
        $.get(window.location.href, {plot: plotname}, function(data){
            if (data.status == '0') {
                layer.open({
                    content: data.info,
                    style: 'background-color:#09C1FF; color:#fff; border:none;',
                    time: 2
                });
            }
            if (data.info.length == 0) {
                $("#plotlist").show();
                $('.plotlist').html('您搜索的小区暂时没有开通业务或没有在您所选择的地区');
            } else {
                var i = 0, plots="";
                for (; i < data.info.length; i++) {
                    plots += '<div class="col-xs-6 mtop15"><a class="plot" style="display:block" href="<?=url('home/index/productshow')?>?ptype=<?=$request->input('ptype')?>&pcate=<?=$request->input('pcate')?>&area=<?=$request->input('area')?>&plot='+data.info[i].id+'">'+data.info[i].name+'</a></div>';
                }
                $("#plotlist").show();
                $('.plotlist').html(plots);
            }
        });
    });
</script>
<?=view("home.common.footer")?>